﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<title>无标题文档</title>
		<meta http-equiv="content-Type" content="text/html;charset=gb2312">
		<script src="../js/DateJS.js" type="text/javascript">
		</script>
	</head>
	<style type="text/css">
		body {
			background-color: #3994EE;
			text-align: center;
		}
		
		.div1 {
			background-image: url(img/1.png);
			width: 118px;
			height: 60px;
			color: #F6F6F6;
			float: left;
		}
		
		.div1:hover {
			background-image: url(img/2.png);
		}
		
		.div1:active {
			background-image: url(img/3.png);
		}
		
		a {
			text-decoration: none;
		}
		
		.div2 {
			height: 1px;
		}
		
		.div3 {
			border: #0CF solid 2px;
			height: 600px;
			margin-top: 65px;
			background-color: #E7FEED;
		}
		
		.table {
			margin: auto;
		}
		
		.input1 {
			background-color: #EEA6AD;
		}
	</style>

	<body>
		<div id="StaffDimission">
			<div class="div2">
				<table width="472" border="0" cellspacing="0" cellpadding="0">
					<tr>
						<td width="118">
							<a href="yggl1.html">
								<div class="div1">
									<h4 style="text-align:center; line-height:0"> 员工入职管理</h4>
								</div>
							</a>
						</td>
						<td width="118">
							<a href="ygxxcx.html">
								<div class="div1">
									<h4 style="text-align:center; line-height:0"> 员工信息中心</h4>
								</div>
							</a>
						</td>
						<td width="118">
							<a href="ygyd1.html">
								<div class="div1">
									<h4 style="text-align:center; line-height:0"> 员工异动管理</h4>
								</div>
							</a>
						</td>
						<td width="118">
							<a href="yggl4.html">
								<div class="div1" style=" background-color:#F90">
									<h4 style="text-align:center; line-height:0"> 员工离职管理</h4>
								</div>
							</a>
						</td>
					</tr>
				</table>
			</div>
			<div class="div3">
				<h1>离职信息填写</h1>
				<div>
					<form onsubmit="return false">
						<table width="571px" height="240px" class="table" border="0" cellspacing="0" cellpadding="0">
							<tr>
								<td width="122" rowspan="8">&nbsp;</td>
								<td width="133" height="30" align="right">员工编号：</td>
								<td width="194" align="left">
									<input v-model="id" type="number" @blur.bative.capture='selectById()' />
									<font color="#FF0000">*</font>
								</td>
								<td width="122">
									<font color="#FF0000" size="-1">注意：" * "为必填项---输入编号后点击姓名可自动生成</font>
								</td>
							</tr>
							<tr>
								<td height="30" align="right">员工姓名：</td>
								<td align="left">
									<input v-model="username" disabled="disabled" />
									<font color="#FF0000">*</font>
								</td>
								<td>&nbsp;</td>
							</tr>
							<tr>
								<td height="30" align="right">离职日期：</td>
								<td align="left">
									<input type="date" v-model="transfer_date" />
									<font color="#FF0000">*</font>
								</td>
								<td>&nbsp;</td>
							</tr>
							<tr>
								<td height="30" align="right">离职类型：</td>
								<td align="left">
									<select v-model="type">
										<option value="主动辞职">主动辞职</option>
										<option value="辞退">辞退</option>
										<option value="退休">退休</option>
										<option value="开除">开除</option>
									</select>
									<font color="#FF0000">*</font>
								</td>
								<td>&nbsp;</td>
							</tr>
							<tr>
								<td height="30" align="right">离职去向：</td>
								<td align="left">
									<input v-model="make_for" />
									<font color="#FF0000"></font>
								</td>
								<td>&nbsp;</td>
							</tr>
							<tr>
								<td height="30" align="right">是否进入人才库：</td>
								<td align="left">
									<input v-model="talent_pool" />
									<font color="#FF0000"></font>
								</td>
								<td>&nbsp;</td>
							</tr>
							<tr>
								<td height="30" align="right">备注：</td>
								<td align="left">
									<input v-model="remarks" /></td>
								<td>&nbsp;</td>
							</tr>
							<tr>
								<td height="30">
									<a href="ygxxcx.html">员工列表查询</a>
								</td>
								<td align="left">
									<input type="button" @click="updateStaffdimission()" value="提交" />
									<input type="reset" value="重置" /></td>
								<td>&nbsp;</td>
							</tr>
						</table>
						<h3 style="color:red;"></h3>
					</form>

				</div>
			</div>
		</div>

		<script src="../js/vue.js"></script>
		<script src="../js/axios.js"></script>
		<script>
			axios.defaults.baseURL = "http://176.55.4.113"
			const StaffDimission = new Vue({
				el: "#StaffDimission",
				data: {
					id: '',
					username: '',
					transfer_date: '',
					type: '主动辞职',
					make_for: '',
					remarks: '',
					talent_pool: ''
				},
				methods: {
					selectById() {
						axios.get("/staff_status/queryByStaffId?id=" + this.id)
							.then(result => {
								if(result.data.data != null) {
									this.username = result.data.data.user_name
								}else{
									alert("查询失败")
								}
					
							})
					},
					updateStaffdimission() {
						axios.put("/staff_status/dimission", {
								id: this.id,
								dis_transfer_date: this.transfer_date,
								dis_type: this.type,
								dis_make_for: this.make_for,
								dis_remarks: this.remarks,
								talent_pool: this.talent_pool
							})
							.then(result => {
								if(result.data.status == 200) {
									alert("修改成功")
								} else {
									alert("修改失败")
								}
							})
					}
				}
			})
		</script>
	</body>

</html>